package com.cw.DesignModel23.Behavioral.VisitorPattern.Visitor1;

import java.util.ArrayList;

public class Main {
    public static void main(String[] args) {
        // 创建存放 Game 的集合
        ArrayList<Game> games = new ArrayList<>();

        // 创建免费游戏
        FreeGame freeGame = new FreeGame();
        freeGame.setGameName("超级马里奥");
        games.add(freeGame);

        // 创建收费游戏
        VipGame vipGame = new VipGame();
        vipGame.setGameName("绝地求生");
        vipGame.setmVipPrice(88);
        games.add(vipGame);

        // Vip 访问者访问免费和收费游戏
        for (Game game : games) {
            game.accept(new VipVisitor());
        }
    }
}
